package com.cuit.zuke.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cuit.zuke.common.util.PageUtil;
import com.cuit.zuke.system.entity.SysLoginLogEntity;
import com.cuit.zuke.system.entity.vo.LoginLogVO;
import com.cuit.zuke.system.entity.vo.LoginVO;
import org.apache.ibatis.annotations.Param;
import org.omg.CORBA.SystemException;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/**
 * @program: zuke
 * @description: 登录日志接口
 * @author: KamTang
 * @create: 2022-04-07 21:51
 **/
public interface SysLoginLogService extends IService<SysLoginLogEntity> {
    /**
     * 添加登入日志
     * @param request request请求
     * @exception UnsupportedEncodingException
     */
    void addLoginReport(HttpServletRequest request) throws UnsupportedEncodingException;


    /**
     * 删除登入日志
     * @param ids
     * @exception SystemException 基类异常
     */
    void deleteBatch(Long[] ids) throws SystemException;


    /**
     * 登入日志列表
     * @param params params
     * @return PageUtil
     */
    PageUtil findLoginLogList(Map<String, Object> params);


    /**
     * 登入报表
     * @param username
     * @return
     */
    List<Map<String, Object>> loginReport(String username);

    /**
     * 获取近一周管理员登录情况和用户注册情况
     * @return
     */
    Map<String, List<?>> getWeeklyAdminLoginAndUserRegData();

    /**
     * 获取上次登录信息
     * @param username 用户名字
     * @return LoginLogVO
     */
    List<LoginLogVO> getLastLoginInfo(String username);
}
